#ifndef _WSGI_HTTP_HPP
#define _WSGI_HTTP_HPP
#include "wsgi/middleware.hpp"

namespace wsgi {
  class Http : public Middleware {
  public:
    Http(Application* app)
      : Middleware(app)
    {}

    std::string call(Environment& env) {
      setupHttpRequest(env);
      const std::string res = this->app_ptr->call(env);
      return createHttpResponse(evn, res);
    }

  protected:
    virtual void setupHttpRequest(Environment& env) {
    }

    virtual std::string createHttpResponse(Environtmet& env,
                                           const std::string res) {
    }
  };
}

#endif
